<script>
import { mapActions } from "vuex";
export default {
  methods: {
    ...mapActions({
      login: "user/login",
    }),
  },
  onLaunch: function () {
    wx.login({
      success: async (res)=>{
        if (res.code) {
          //发起网络请求
					await this.login(res.code);
        } else {
          console.log("登录失败！" + res.errMsg);
        }
      },
    });
  },
  onShow: function () {
    console.log("App Show");
  },
  onHide: function () {
    console.log("App Hide");
  },
};
</script>

<style>
/*每个页面公共css */
*{
  padding: 0;
  margin: 0;
  list-style: none;
  text-decoration: none;
  box-sizing: border-box;
}
html,body{
  width: 100%;
  height: 100%;
}


</style>
